:root {
    --primary-color: #5148e7;
    --secondary-color: #10b981;
    --tertiary-color: #3b82f6;
    --light-bg: #f9fafb;
    --border-color: #e5e7eb;
    --chat-bg: #f1f5f9;
    --sent-msg-bg: #4f46e5;
    --received-msg-bg: #fff;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--light-bg);
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.chat-item:hover, .chat-item.active {
    background-color: var(--light-bg);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;
}

.chat-info {
    flex: 1;
    overflow: hidden;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-message {
    color: #6b7280;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    text-align: right;
}

.chat-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.unread-count {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    text-align: center;
    line-height: 20px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--chat-bg);
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
}

.chat-header-info {
    flex: 1;
    margin-left: 15px;
}

.chat-header-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.chat-header-status {
    font-size: 0.8rem;
    color: #6b7280;
}

.chat-header-actions {
    display: flex;
    gap: 15px;
}

.chat-header-actions a {
    color: #6b7280;
    font-size: 1.2rem;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 70%;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
}

.message-sent {
    align-self: flex-end;
    background-color: var(--sent-msg-bg);
    color: white;
    border-bottom-right-radius: 0;
}

.message-received {
    align-self: flex-start;
    background-color: var(--received-msg-bg);
    border-bottom-left-radius: 0;
}

.message-time {
    font-size: 0.7rem;
    margin-top: 5px;
    text-align: right;
}

.message-sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message-received .message-time {
    color: #6b7280;
}

.chat-input {
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid var(--border-color);
}

.chat-input-container {
    display: flex;
    align-items: center;
    background-color: var(--light-bg);
    border-radius: 10px;
    padding: 5px 15px;
}

.chat-input-actions {
    display: flex;
    gap: 15px;
    padding: 10px 0;
}

.chat-input-actions a {
    color: #6b7280;
    font-size: 1.2rem;
}

.chat-input textarea {
    flex: 1;
    border: none;
    background-color: transparent;
    resize: none;
    padding: 10px 0;
    max-height: 100px;
}

.chat-input textarea:focus {
    outline: none;
}

.send-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.message-date-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.separator-line {
    border-top: 1px solid var(--border-color);
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    z-index: 1;
}

.separator-text {
    background-color: var(--chat-bg);
    padding: 0 10px;
    position: relative;
    z-index: 2;
    display: inline-block;
    font-size: 0.85rem;
    color: #6b7280;
}

.no-chat-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    text-align: center;
    padding: 20px;
}

.no-chat-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    opacity: 0.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .chat-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 10;
        background-color: #fff;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .chat-sidebar.active {
        transform: translateX(0);
    }

    .chat-main {
        width: 100%;
    }

    .toggle-sidebar {
        display: block !important;
    }
}
